package com.mew.chess.core.game.lh.game.common;



public enum LhCard {

  DIAMOND_A(1, 1, CardType.Diamond),
  DIAMOND_2(2, 2, CardType.Diamond),
  DIAMOND_3(3, 3, CardType.Diamond),
  DIAMOND_4(4, 4, CardType.Diamond),
  DIAMOND_5(5, 5, CardType.Diamond),
  DIAMOND_6(6, 6, CardType.Diamond),
  DIAMOND_7(7, 7, CardType.Diamond),
  DIAMOND_8(8, 8, CardType.Diamond),
  DIAMOND_9(9, 9, CardType.Diamond),
  DIAMOND_10(10, 10, CardType.Diamond),
  DIAMOND_J(11, 10, CardType.Diamond),
  DIAMOND_Q(12, 10, CardType.Diamond),
  DIAMOND_K(13, 10, CardType.Diamond),

  CLUB_A(1, 1, CardType.Club),
  CLUB_2(2, 2, CardType.Club),
  CLUB_3(3, 3, CardType.Club),
  CLUB_4(4, 4, CardType.Club),
  CLUB_5(5, 5, CardType.Club),
  CLUB_6(6, 6, CardType.Club),
  CLUB_7(7, 7, CardType.Club),
  CLUB_8(8, 8, CardType.Club),
  CLUB_9(9, 9, CardType.Club),
  CLUB_10(10, 10, CardType.Club),
  CLUB_J(11, 10, CardType.Club),
  CLUB_Q(12, 10, CardType.Club),
  CLUB_K(13, 10, CardType.Club),

  HART_A(1, 1, CardType.Hart),
  HART_2(2, 2, CardType.Hart),
  HART_3(3, 3, CardType.Hart),
  HART_4(4, 4, CardType.Hart),
  HART_5(5, 5, CardType.Hart),
  HART_6(6, 6, CardType.Hart),
  HART_7(7, 7, CardType.Hart),
  HART_8(8, 8, CardType.Hart),
  HART_9(9, 9, CardType.Hart),
  HART_10(10, 10, CardType.Hart),
  HART_J(11, 10, CardType.Hart),
  HART_Q(12, 10, CardType.Hart),
  HART_K(13, 10, CardType.Hart),

  SPADE_A(1, 1, CardType.Spade),
  SPADE_2(2, 2, CardType.Spade),
  SPADE_3(3, 3, CardType.Spade),
  SPADE_4(4, 4, CardType.Spade),
  SPADE_5(5, 5, CardType.Spade),
  SPADE_6(6, 6, CardType.Spade),
  SPADE_7(7, 7, CardType.Spade),
  SPADE_8(8, 8, CardType.Spade),
  SPADE_9(9, 9, CardType.Spade),
  SPADE_10(10, 10, CardType.Spade),
  SPADE_J(11, 10, CardType.Spade),
  SPADE_Q(12, 10, CardType.Spade),
  SPADE_K(13, 10, CardType.Spade);

  public final int power;
  public final int num;
  public final CardType type;

   LhCard(int num, int power, CardType type) {
     this.num = num;
    this.power = power;
    this.type = type;
  }

  public int power(){
     return power;
  }

  public int num(){
     return num;
  }

  public static LhCard card(int cardId) {
    cardId -= 1;
    if (cardId < 0 || cardId >= values().length) {
      System.out.println(cardId);
      throw new IllegalArgumentException("carId必须在[1,52]范围内");
    }
    return values()[cardId];
  }


}
